<%@ page import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<style type="text/css">
body {
	font-size: 12px;
}
</style>
<script type="text/javascript" src="js/jquery-1.4.1.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$(":button").click(function(){
		var username = $("#username").val();
		if (username == "") {
			$("#validateInfo").html("用户名不能为空");
			
			return;
		}
		
		/*var param = $.param({
			username : username,
			gender : $(":radio:checked").val()
		});*/
		
		document.form1.submit();
		
		//window.location.href = "${pageContext.request.contextPath}/LoginServlet?" + param;
	});
});

function validate(){
	
	var form = document.form1;
	var username = form.username.value;
	var info = document.getElementById("validateInfo");

	info.innerHTML = "";

	if(username == ""){
		info.innerHTML = "用户名不能为空";
		return;
	}
	
	form.submit();
}
</script>
</head>
<body>
<form name="form1" action="${pageContext.request.contextPath}/LoginServlet" method="post">

<table>
<tr>
	<td colspan="2" style="font-family: 黑体;font-weight: bold; font-size: 18px;">-= 远标聊天室 =-</td>
</tr>
<tr>
	<td>
		用户名：
	</td>
	<td>
		<input type="text" id="username" name="username" maxlength="8">
		<label id="validateInfo" style="color:red;">${error}</label>
	</td>
</tr>
<tr>
	<td>
		你是：
	</td>
	<td>
		<input type="radio" name="gender" value="male" checked="checked">男生
		<input type="radio" name="gender" value="female" style="padding-left: 20px;">女生
	</td>
</tr>
<tr>
	<td colspan="2">
		<!-- onclick="//validate();" -->
		<input type="button" value="登录" >
		<label style="font-size: 12px; color: red;">（注：无需注册）</label>
	</td>
</tr>
</table>
</form>
</body>
</html>
